import Tool from "@/utils/tool";
import { isMultiple } from "ant-design-vue/es/vc-select/BaseSelect";
const uuid = Tool.uuid();
const Cttrs = [
  {
    type: "Switch",
    field: "isSelection",
    allowClear: true,
    label: "是否可选",
    col: "sgl2-l",
    code: "sgl",
    value: false,
    placeholder: "是否可选",
  },
  {
    type: "Switch",
    field: "pagination",
    allowClear: true,
    label: "显示分页",
    col: "sgl2-c",
    code: "sgl",
    value: true,
    placeholder: "显示分页",
  },
  {
    type: "InputNumber",
    field: "pageSize",
    allowClear: true,
    label: "页码",
    value: "10",
    placeholder: "分页页码",
    col: "sgl2-r",
    code: "sgl",
  },
  {
    type: "Input",
    field: "apiUrl",
    allowClear: true,
    label: "接口地址",
    value: "",
    placeholder: "接口地址",
    col: "sgl",
    code: "sgl",
  },
  {
    type: "Select",
    field: "btns",
    allowClear: true,
    label: "表格按钮",
    mode: "multiple",
    value: ["add", "edit", "delete"],
    options: [
      {
        label: "新增",
        value: "add",
      },
      {
        label: "编辑",
        value: "edit",
      },
      {
        label: "删除",
        value: "delete",
      },
    ],
    placeholder: "表格按钮",
    col: "sgl",
    code: "sgl",
  },
];

const Attrs = [
  {
    type: "Input",
    field: "title" + "-" + uuid,
    allowClear: true,
    label: "",
    value: "",
    placeholder: "列名称",
    rules: [
      {
        required: true,
        message: "请输入列名称",
        trigger: "blur",
      },
    ],
  },
  {
    type: "Input",
    field: "key" + "-" + uuid,
    allowClear: true,
    label: "",
    value: "",
    placeholder: "列字段值",
    rules: [
      {
        required: true,
        message: "请输入列字段值",
        trigger: "blur",
      },
    ],
  },
  {
    type: "Input",
    field: "slotName" + "-" + uuid,
    allowClear: true,
    label: "",
    value: "",
    placeholder: "插槽名称",
  },
  {
    type: "icon",
    field: "adb" + "-" + uuid,
    icon: "icon iconfont icon-delete",
    size: 4,
    allowClear: true,
  },
];

export default {
  Attrs: [...Cttrs],
  Bttrs: Attrs,
  Cttrs,
  btns: [
    {
      icon: "",
      label: "添加表头",
      type: "add",
    },
    {
      icon: "",
      label: "表格弹窗",
      type: "modal",
    },
  ],
};
